<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
        <title>GroupBox Test Page</title>
		<script type="text/javascript" src="../../include-all.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<script type="text/javascript">
		var view = new dorado.widget.View({ layout: "Dock" });

        var rows1 = [], list = ["IE", "Opera", "FireFox", "Chrome", "Safari", "Mozilla", "NetScape"];
        for (var i = 0; i < 50; i++) {
            var row = {};
            for (var j = 0; j < 10; j++) {
                row["prop" + j] = (Math.random() < 0.1) ? "ABC\nDEF\nGHI" : [i, j];
            }
            row["prop0"] = list[parseInt(Math.random() * 6)];
            row["prop5"] = parseInt(Math.random() * 100);
            rows1.push(row);
        }

        var grid1 = new dorado.widget.Grid({
            id: "grid1",
            scrollMode: "viewport",
            showFooter: true,
            width: 650,
            height: 400,
            fixedColumnCount: 2,
            dynaRowHeight: true,
            groupOnSort: true,
            showGroupFooter: true,
            showFilterBar: true,
            columns: [{
            }, {
                property: "prop0"
            }, {
                name: "id",
                property: "prop1",
                displayFormat: "#",
                summaryType: "count"
            }, {
                name: "name",
                property: "prop2"
            }, {
                property: "prop3",
                filterable: false
            }, {
                property: "prop4"
            }, {
                property: "prop5",
                dataType: "float",
                displayFormat: "#,##.00",
                summaryType: "average"
            }, {
                property: "prop6"
            }, {
                property: "prop7"
            }, {
                property: "prop8"
            }],
            items: rows1
        });

        var fieldSet = new dorado.widget.FieldSet({
            layoutConstraint: "top",
            caption: "测试测试",
            width: 500,
            collapseable: true,
            collapsed: true,
            children: [new dorado.widget.Button({
                caption: "测试子组件",
                listener: {
                    onClick: function() {
                        alert(123);
                    }
                }
            })],
            buttons: [new dorado.widget.Button({
                caption: "确定",
                width: 80,
                listener: {
                    onClick: function(){
                    }
                }
            }), new dorado.widget.Button({
                caption: "取消",
                width: 80,
                listener: {
                    onClick: function(){
                    }
                }
            })]
        });
 
		view.addChild(fieldSet);
 
        var groupBox = new dorado.widget.GroupBox({
            caption: "GroupBox",
            width: 300,
            height: 200,
            collapseable: true,
            collapsed: false,
            children: [grid1],
            layout: { $type: "Native" },
            buttons: [new dorado.widget.Button({
                caption: "确定",
                width: 80,
                listener: {
                    onClick: function(){
                    }
                }
            }), new dorado.widget.Button({
                caption: "取消",
                width: 80,
                listener: {
                    onClick: function(){
                    }
                }
            })]
        });
 
        view.addChild(groupBox);
 
		$(document).ready(function(){
			view.render(document.body);
		});
		</script>
	</head>
	<body>
	</body>
</html>
